package jkim.plugin.daframe.ext.sql.model;

import java.util.ArrayList;


public class DaframeSQLLogInfoList {

	private static final int DEFAULT_LIMITE = 100;

	private ArrayList<DaframeSQLLogInfo> logList = null;
	private int limite = DEFAULT_LIMITE;
	
	DaframeSQLLogInfoList() {
		super();
		this.logList = new ArrayList<DaframeSQLLogInfo>();
	}

	public void setLimite(int limite) {
		this.limite = limite;
	}
	
	public ArrayList<DaframeSQLLogInfo> getList() {
		return logList;
	}
	public boolean add(DaframeSQLLogInfo logInfo) {
		if ((this.logList.size()+1) > limite) {
			logList.remove(0);
		}
		return this.logList.add(logInfo);
	}

	public void clear() {
		this.logList.clear();
	}
	public int getSize() {
		return this.logList.size();
	}
	
}
